/*
 * ConcreteIterator.h - Grupo 5 - Prog. Avanzada 2011
 *
 *  Javier Dominguez - 4.901.161-6
 *  Marcelo Parada - 1.977.094-9
 *  Rodrigo Ruiz - 4.481.611-2
 *  Maximiliano Silvera - 4.106.938-6
 */

#ifndef CONCRETEITERATOR_H_
#define CONCRETEITERATOR_H_

#include "../collections/IIterator.h"

template<class Type>
class ConcreteIterator
{
private:
	IIterator *iter;

public:
	ConcreteIterator(IIterator *iter);

	virtual void next();

	virtual Type current();

	virtual bool hasCurrent();

	virtual ~ConcreteIterator();
};

template<typename Type>
ConcreteIterator<Type>::ConcreteIterator(IIterator *iter)
{
	this->iter = iter;
}

template<typename Type>
void ConcreteIterator<Type>::next()
{
	iter->next();
}

template<typename Type>
Type ConcreteIterator<Type>::current()
{
	return (Type) iter->current();
}

template<typename Type>
bool ConcreteIterator<Type>::hasCurrent()
{
	return iter->hasCurrent();
}

template<typename Type>
ConcreteIterator<Type>::~ConcreteIterator()
{
	delete iter;
}

#endif /* CONCRETEITERATOR_H_ */
